<?php
include 'checkSession.php';
$pageName = "SignPost";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
	<title>Sign Inventory</title>
	<link rel="stylesheet" href="css/style.css" type="text/css" media="all" />
		 <script laguage='javascript'>
function openInIFrame(url)
{
top.frames['frm02'].location.href = url;
top.parent.document.getElementById('myFrameset').cols = '0%,*';
}
</script>
</head>
<body>
<!-- Header -->
<div id="header">
	<div class="shell">
		<!-- Logo + Top Nav -->
				<?php include "header-top.php";?>

		<!-- End Logo + Top Nav -->
		
		<!-- Main Nav -->
				<?php include "menu-tab.php";?>

		<!-- End Main Nav -->
	</div>
</div>
<!-- End Header -->

<!-- Container -->
<div id="container" style="height:auto;">
	<div class="shell">
		
		<!-- Small Nav -->
		<div class="small-nav">
			<a href="#">Sign Post</a>
			<span>&gt;</span>
			Sign Post Listing
		</div>
		<!-- End Small Nav -->
		
		<!-- Message OK --><!-- End Message OK -->		
		
		<!-- Message Error -->
		<!-- End Message Error -->
        <br />
		<!-- Main -->
		<div id="main">
		<table width="100%" border="0" cellspacing="0" cellpadding="0">
			  <tr>
				<td width="60%" height="30" align="center"><?php
				if(isset($_REQUEST['msg'])) {
					if($_REQUEST['msg'] == "del") {
						echo '<span style="color:#CC0000;font-size:12px;">Sign Post deleted sucessfully.';
					}
				}
				 ?></td>
				<td width="12%" height="30" align="right" valign="top"><a href="signPostManager.php?action=add">Create New</a>&nbsp;&nbsp;&nbsp;&nbsp;</td>
			    <td width="10%" align="left" valign="top">
				<INPUT type="button" value="Show Map" onClick="top.parent.document.getElementById('myFrameset').cols = '0%,*'" class="button">
				</td>
				<!--<td width="13%" align="left" valign="top">
				<INPUT type="button" value="Edit Post On Map" onClick="window.location.href='EditSignPostManager.php'" class="button">
				
								</td>-->
			    <td width="15%" align="left" valign="top">
				<input name="button" type="button" class="button" onclick="window.location.href='AddSignPostManager.php'" value="Show Entire Map" />
				
				</td>
			  </tr>
		  </table>
		  
		 
			<div class="cl">&nbsp;</div>
			
			
			<!-- Content -->
			<div id="content" style="width:100%">
				
				<!-- Box -->
				<div class="box">
					<!-- Box Head -->
					<div class="box-head">
						<h2 class="left">Sign Post</h2>
													
					</div>
					<!-- End Box Head -->	

					<!-- Table -->
					<div class="table">
						<table width="100%" border="0" cellspacing="0" cellpadding="0">
							<tr>
								<th width="37">&nbsp;</th>
								<th width="207">Post ID</th>
								<th width="178">Street1</th>
								<th width="208">Street2</th>
								<th width="208">Type</th>
								<th width="208">Material</th>
								<th width="158">Length</th>
								<th width="50">Map</th>
								<th>Edit</th>
								<th width="130">View</th>
								<th width="102">Delete</th>
								
								
							</tr>
							<?php
		  $ListQry = "SELECT * FROM `Sign_Posts`";
		  
		  $ListExe = mysql_query($ListQry);
		  $totalData = mysql_num_rows($ListExe);
		  
		  include 'paginationCal.php';		
			$ListQry .= $limit;
			$ListExe = mysql_query($ListQry);
			
			
		  $s = 1;
		  if(mysql_num_rows($ListExe) > 0) {
		  while($ListRow = mysql_fetch_array($ListExe)) {
		  if($s%2 == 0) {
			$bgStyle = 'tableEvenRow';
			} else {
			$bgStyle = 'tableOddRow';
			}
			
		  ?>
          <tr style="font-size:12px; color:#OOOOOO;" class="<?php echo $bgStyle;?>" onmouseover="this.className='highlight'" onmouseout="this.className='<?php echo $bgStyle;?>'" height="33">
            <td height="28" style="padding-left:10px;">&nbsp;</td>
            <td height="28" align="left"><?php echo $ListRow['sp_id'];?></td>
			 <td height="28" align="left"><?php echo $ListRow['sp_street1'];?></td>
			  <td height="28" align="left"><?php echo $ListRow['sp_street2'];?></td>
			<td width="124" height="30" align="left"><?php echo $ListRow['sp_type'];?></td>
			<td width="124" height="30" align="left"><?php echo $ListRow['sp_material'];?></td>
			<td width="124" height="30" align="left"><?php echo $ListRow['sp_length'];?></td>
			<td height="28" align="left">
			<a href="javascript:openInIFrame('selected_Sign_Post.php?id=<?php echo $ListRow['sp_id'];?>')"><img src="images/show_map.png" alt="Map" title="Map" width="20" height="20" border="0" /></a>
			</td>
			<td height="28" align="left">
			<a href="signPostManager.php?id=<?php echo $ListRow['sp_id'];?>&action=edit"><img src="images/edit-icon.gif" alt="Edit" title="Edit" width="20" height="20" border="0" /></a>
			</td>
			<td height="28" align="left">
			<a href="signPostManager.php?id=<?php echo $ListRow['sp_id'];?>&action=view"><img src="images/view.png" alt="View" title="View" width="20" height="20" border="0" /></a>
			</td>
			<td height="28" align="left">
			<a href="signPostManagerAction.php?id=<?php echo $ListRow['sp_id'];?>&action=delete"><img height="15" title="Delete" alt="Delete" src="images/delete_icon.gif" width="15" border="0" onclick="return confirm('Are you sure to Delete!');"/></a>
			</td>
			
            
          </tr>
          <?php
		  $s++;
		  }
		  } else {
		  ?>
          <tr>
            <th height="25" colspan="10" style="font-size:11px; color:#FFFFFF; padding-left:450px; color:#000000;" align="center">No more Sign Post </th>
          </tr>
          <?php
		  }if($totalData > 100) {
		  ?>
          <tr bgcolor="#FBFBFB">
            <td height="25" colspan="10" style="font-size:11px; color:#FFFFFF; padding-left:50px; color:#000000;" align="right"><?php 
			
			include 'paginationDis.php';
			?></td>
          </tr>
          <?php
			}
			?>
			 <tr bgcolor="#FBFBFB">
            <td height="25" colspan="10" style="font-size:11px; color:#FFFFFF; padding-left:50px; color:#000000;" align="right">
			
			</td>
          </tr>

						</table>
						
						
						
					</div>
					<!-- Table -->
					
				</div>
            </div>
<div class="cl">&nbsp;</div>			
		</div>
		<!-- Main -->
	</div>
</div>
<!-- End Container -->

<!-- Footer -->
<?php include 'footer.php';?>
<!-- End Footer -->
	
</body>
</html>